package com.qfedu.meidijiaju.controller;


import com.qfedu.meidijiaju.entity.ResponseData;
import com.qfedu.meidijiaju.entity.TvXh;
import com.qfedu.meidijiaju.entity.XyjXh;
import com.qfedu.meidijiaju.service.TvXhService;
import com.qfedu.meidijiaju.service.XyjXhService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@Api(tags = "洗衣机型号查询模块接口")
@RestController
public class XyjXhController {
    @Autowired
    private XyjXhService xyjXhService;

    @ApiOperation("查询洗衣机型号")
    @RequestMapping(value = "/XyjXh/queryXyjXh",method = RequestMethod.GET)
    public ResponseData<List<XyjXh>> queryXyjXh() {
        ResponseData<List<XyjXh>> responseData = new ResponseData<>();
        List<XyjXh> result = xyjXhService.queryXyjXh();
        int count = xyjXhService.queryCount();
        if (result != null) {
            responseData.setCode(0);
            responseData.setData(result);
            responseData.setCount(count);
        }
        return responseData;
    }
}
